package edu.jetwinner.common;

import java.util.HashMap;
import java.util.Map;

/**
 * @author xulixin
 */
public final class EasyMapUtil {

    private EasyMapUtil() {
        // reserved.
    }

    public static <K, V> boolean isEmpty(Map<K, V> map) {
        if (map == null) {
            return true;
        }
        return map.size() == 0;
    }

    public static <K, V> boolean isNotEmpty(Map<K, V> map) {
        return !isEmpty(map);
    }

    public static <K, V> HashMap<K, V> newHashMap() {
        return new HashMap<K, V>();
    }

    public static <K, V> HashMap<K, V> newHashMap(int initialCapacity) {
        return new HashMap<K, V>(initialCapacity);
    }
}
